﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyInvoice.Model
{
    public class InvoiceDetails
    {
        private int _Id;
        private int _InvoiceId;
        private string _Description;
        private decimal _Price;
        private int _Units;


        #region Database Columns

        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this._Id = value;
            }
        }
        public int InvoiceId
        {
            get
            {
                return this._InvoiceId;
            }
            set
            {
                this._InvoiceId = value;
            }
        }

        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this._Description = value;
            }
        }

        public decimal Price
        {
            get
            {
                return this._Price;
            }
            set
            {
                this._Price = value;
            }
        }

        public int Units
        {
            get
            {
                return this._Units;
            }
            set
            {
                this._Units = value;
            }
        }

        #endregion

        #region Constructor

        public InvoiceDetails() { }

        public InvoiceDetails(Invoice Parent)
        {
            this._InvoiceId = Parent.Id;
            this._Id = 0;
            this._Description = String.Format("IT Services according to Contract for month {0} {1}", Parent.Date.ToString("MMMM"), Parent.Date.Year.ToString());
            this._Price = 0;
            this._Units = 0;

        }

        public InvoiceDetails(Invoice Parent, string Description)
        {
            this._Id = 0;
            this._InvoiceId = Parent.Id;
            this._Description = Description;
            this._Price = 0;
            this._Units = 0;
        }

        #endregion

    }
}
